package com.wtf.controller;

import com.wtf.service.EmailService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author tengfei wang
 * @version 1.0
 * @date Created in 2020/11/2
 */
@RestController
@RequestMapping("/email")
public class EmailController {

    @Resource
    private EmailService emailService;

    @RequestMapping("/{email}/{code}")
    public boolean sendEmail(@PathVariable("email") String email,@PathVariable("code") Integer code) {
        return emailService.sendEmail(email, code);
    }
}
